from fastapi import APIRouter,Depends
from pydantic import BaseModel

from backend.app.app.crud_pro.tb_userpro_base import get_all_project,get_share_pro
from backend.app.app.crud_pro.tb_userpro_share import get_uid_proid
from backend.app.app.api.api_v1.user import verify_token_user

router_open_project = APIRouter(prefix="/open_project", tags=["打开工程"])

class u_id(BaseModel):
    user_id : str

@router_open_project.post("/get_all_inf",name="获取所有工程信息,包括共享工程信息")
async def get_all_inf(id:u_id,ver = Depends(verify_token_user)):
    result = get_all_project(id.user_id)
    return {
            "result": result,
            "ver_token":ver
    }



